#include <stdio.h>
#include <stdlib.h>

int main()
{
     int a[100] ;
    int i ;
    char temp[100];
    for( i = 0 ;100 > i ; i++ )
    {
        scanf( "%d" ,&a[i] );
        temp[i] = getchar();                    //输出字符（eg:输出回车以及空格）
        if ( a[i] == 0 )
        break;
    }
    printf ( "the length of array is %d\n",i );
    int l ;
    int t;
    int d;
    printf("The sorted array is:\n") ;
    for ( d = i - 1 ; d >= 1 ; --d )
        for ( l = 0 ; l < (i - 1 ) ; l++ )
        {
            if( a[l] > a[l+1] )
            {
                t = a[l] ;
                a[l] = a [l+1] ;
                a[l+1] = t ;
            }
        }
    for( l = 0 ; l < i ; l++ )
    printf("%3d" , a[l] );
    return 0;
}
